// Copyright (C) 2011  Andrew H. Chan
// 
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

#ifndef _SAMPLER_H__
#define _SAMPLER_H__

#include "typedefs.h"
#include "input_data.h"
#include "table.h"

class Sampler {
    public:
        Sampler(Input_data const& input_data);

        int gibbs_sample(uint iterations);

        Input_data data;
        uint num_haps;
        uint segsites;
        std::vector<std::vector<int> > gen_het_index;
        std::vector<int> gen_het_num;
        std::vector<std::vector<int> > hap_counts0;
        std::vector<std::vector<int> > hap_counts1;
        std::vector<std::vector<int> > inf_haps;
        std::vector<int> comparison_num_mistakes;
        std::vector<boost::unordered_map<std::pair<std::vector<int>, std::vector<int> >, int> > posterior_counts;
};

#endif
